package com.itboye.hutouben.activity.qianbao;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.itboye.hutouben.R;
import com.itboye.hutouben.activity.mysetting.SettingActivity;
import com.itboye.hutouben.base.BaseActivity;
import com.itboye.hutouben.presenter.SystemMessgeAPresenter;
import com.itboye.hutouben.util.ByAlert;
import com.itboye.hutouben.util.Const;
import com.itboye.hutouben.util.IsUtilUid;
import com.itboye.hutouben.util.OnPasswordInputFinish;
import com.itboye.hutouben.util.PasswordView;
import com.itboye.hutouben.util.SPUtils;
import com.itboye.hutouben.util.XImageLoader;
import com.itboye.hutouben.volley.ResultEntity;

import java.util.Observable;
import java.util.Observer;

/**
 * 记得支付密码
 */
public class JiDeZhiFuPassActivity extends BaseActivity {
    TextView add_shap_title_tv, add_lift_tv;
    ImageView close_icon;

    PasswordView pwdView;// 支付密码
    String paypent_pass;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ji_de_zhi_fu_pass);
        add_shap_title_tv.setVisibility(View.GONE);
        add_lift_tv.setText(R.string.chongzhi_zhifu_pass);

        final PasswordView pwdView = (PasswordView) findViewById(R.id.pwd_view);

        // 添加密码输入完成的响应
        pwdView.setOnFinishInput(new OnPasswordInputFinish() {
            @Override
            public void inputFinish() {
                // 输入完成后跳转
                // 也就是说——>实现你的交易逻辑什么的在这里写

                paypent_pass = pwdView.getStrPassword();

                Intent intent = new Intent(JiDeZhiFuPassActivity.this, JiDePassTwoActivity.class);
                intent.putExtra("paypent", paypent_pass);
                startActivity(intent);
            }
        });
        //返回
        IntentFilter intentFilterExit = new IntentFilter(
                "sendIntent");
        registerReceiver(nichengBroadcastReceiver, intentFilterExit);
    }

    BroadcastReceiver nichengBroadcastReceiver = new BroadcastReceiver() {
        public void onReceive(Context context, Intent intent) {
            finish();
        }

        ;
    };

    @Override
    protected void onInit() {


    }

    @Override
    protected void onReadIntent(Bundle bundle) {

    }

    @Override
    public void onClick(View v) {

    }


}
